import {getConfig} from "@/api/setup";


export default {
    state: {
        OrderList: [],
        systemInfo: {},
        loginType: -1,
    },
    getters: {
        getSystemInfo: (state) => state.systemInfo,
        getLoginType: (state) => state.loginType
    },
    mutations: {

        setSystemInfo(state, data) {
            state.systemInfo = data;
        },
        setLoginType(state, data) {
            state.loginType = data;
        }
    },
    actions: {
        async fetchSystemConfig({commit}) {
            const {data, loginType} = await getConfig({ident: 'system'});
            data && commit('setSystemInfo',data);
            loginType && commit('setLoginType',loginType);

        }
    }
}
